package com.example.springLearning.part5.controller;

import com.example.springLearning.part5.entity.Student;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/spring/part5")
@Slf4j
public class part5Controller3 {


    @Value("#{studentabc}")
    private Student student;

    @Value("#{student1}")
    private Student student2;

    @RequestMapping(path = "bean3", method = RequestMethod.GET)
    public String hi2() {
        return student.toString();
    }

    @RequestMapping(path = "students3", method = RequestMethod.GET)
    public String students() {
        return student2.toString();
    }
}
